package com.own.business.creditbank.function;

import com.alibaba.fastjson2.JSON;
import com.own.business.creditbank.model.result.StoreInfo;

import java.math.BigDecimal;
import java.util.List;

/**
 * ResolveFunctionStatic
 *
 * @author chenxueli
 * @date 2022-08-11 10:54:00
 */
public class ResolveFunctionStatic {

    public static final ResolveFunction<String> STRING_RESOLVE = content -> content;

    public static final ResolveFunction<BigDecimal> BIG_DECIMAL_RESOLVE = BigDecimal::new;

    public static final ResolveFunction<Integer> INTEGER_RESOLVE = Integer::valueOf;

    public static final ResolveFunction<Long> LONG_RESOLVE = Long::valueOf;

    public static final ResolveFunction<Boolean> BOOLEAN_RESOLVE = Boolean::valueOf;

    /**
     * 信息存储解析方法
     */
    public static final ResolveFunction<List<StoreInfo>> STORE_INFO_RESOLVE = content -> JSON.parseArray(content, StoreInfo.class);

}
